﻿@using EC.Entity.Response.Merchant
@using EC.Entity.Enum

@model EC.Entity.PagedList<MerchantQueryResponse>
<div class="data-body data-scroll">
    <div class="data-view">
        <div class="data-div-view table-responsive">
            <table class="table table-hover table-striped table-bordered">
                <thead>
                    <tr>
                        <th class="t_l">商户名称</th>
                        <th class="t_c wd75">商户号</th>
                        <th width="75">下发余额</th>
                        <th width="75">下发冻结</th>
                        <th width="75">存款余额</th>
                        <th width="75">存款冻结</th>

                        <th width="75">内充费率</th>
                        <th width="75">存款费率</th>
                        <th width="75">宝转卡费率</th>
                        <th width="75">单笔支付</th>
                        <th width="75">单笔结算</th>
                        @*<th width="75">带手续费</th>
                        <th width="75">不带续费</th>*@
                        <th class="t_c wd75">状态</th>
                        <th class="t_c wd200">操作</th>
                    </tr>
                </thead>
                <tbody>
                    @if (Model != null && Model.TData != null && Model.TData.Any())
                    {
                        foreach (var item in (IEnumerable<MerchantQueryResponse>)Model.TData)
                        {
                    <tr>
                        <td class="t_l">@(item.Name)</td>
                        <td class="t_c wd75">@(item.Id)</td>
                        <td class="t_r wd75">@(item.PaymentBalance)</td>
                        <td class="t_r wd75">@(item.PaymentProxyFrozenBalance)</td>
                        <td class="t_r wd75">@(item.DepositBalance)</td>
                        <td class="t_r wd75">@(item.DepositProxyFrozenBalance)</td>

                        <td class="t_r wd75">@(decimal.Round(item.PaymentRate * 100, 2) + "%")</td>
                        <td class="t_r wd75">@(decimal.Round(item.DepositRate * 100, 2) + "%")</td>
                        <td class="t_r wd75">@(decimal.Round(item.DepositAliPayRate * 100, 2) + "%")</td>
                        <td class="t_r wd75">@(item.PaymentSingle)</td>
                        <td class="t_r wd75">@(item.SettleSingle)</td>
                        @*<td class="t_r wd75">
                            <button type="button" class="btn btn-default btn-xs" data-modal="/Sy/WithRecharge?id=@(item.Id)" data-title="充值" data-width="450" data-height="200">
                                <span class="glyphicon glyphicon-edit"></span> 充值
                            </button>
                        </td>
                        <td class="t_r wd75">
                            <button type="button" class="btn btn-default btn-xs" data-modal="/Sy/Recharge?id=@(item.Id)" data-title="充值" data-width="450" data-height="200">
                                <span class="glyphicon glyphicon-edit"></span> 充值
                            </button>
                        </td>*@
                        <td class="t_c wd75">
                            @(item.Status == (sbyte)UserGroupStatus.启用 ? Html.Raw("<span class='green bold'>启用</span>") : Html.Raw("<span class='red bold'>禁用</span>"))
                        </td>
                        <td class="t_c wd200">
                            @if (item.Status == (sbyte)UserGroupStatus.启用)
                            {
                                <a class="btn btn-danger btn-xs" data-confirm="确定要禁用该商户？" data-succesFun="doSearch()" data-href="/Merchant/UpdateStatus?id=@(item.Id)&status=@((sbyte)UserGroupStatus.禁用)">禁用</a>
                            }
                            else
                            {
                                <a class="btn btn-primary btn-xs" data-confirm="确定要启用该商户？" data-succesFun="doSearch()" data-href="/Merchant/UpdateStatus?id=@(item.Id)&status=@((sbyte)UserGroupStatus.启用)">启用</a>
                            }
                            <button type="button" class="btn btn-default btn-xs" data-modal="/Merchant/Token?MerchantId=@(item.Id)" data-title="接口授权" data-width="600" data-height="200">
                                <span class="glyphicon glyphicon-edit"></span> 接口授权
                            </button>

                            <button type="button" class="btn btn-default btn-xs" data-modal="/Sy/MerchantsEdit/@(item.Id)" data-title="编辑" data-width="452" data-height="450">
                                <span class="glyphicon glyphicon-edit"></span> 编辑
                            </button>
                        </td>
                    </tr>
                        }
                    }
                    else
                    {
                        <tr>
                            <td colspan="12" class="t_c">暂无记录</td>
                        </tr>
                    }
                </tbody>
            </table>
        </div>
    </div>
</div>
<!-- 必要的分页参数设置 -->
<input type="hidden" id="TotalCount" value="@(Model != null ? Model.TotalCount : 0)" />